using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
using Blog.Model;
using Blog.Model.DTO;

namespace Blog.WebApi.AutoMapper
{
    public class CustomAutomapperProfile : Profile
    {
        public CustomAutomapperProfile()
        {
            CreateMap<WriterInfo, WriterDTO>();
            CreateMap<BlogNews, BlogNewDTO>()
            .ForMember(dest => dest.TypeName, sourse => sourse.MapFrom(src => src.TypeInfos.Name))
            .ForMember(dest => dest.WriterName, sourse => sourse.MapFrom(src => src.WriterInfos.Name));

        }
    }
}